Skip to content

Conversation

@lifubang
Copy link
Member

We have moved the error msg display position in #3385, I think it's reasonable to display the container init msg in one place, but in this PR, we changed an error ignore behavior in https://github.com/opencontainers/runc/blob/main/libcontainer/init_linux.go#L112-L113 .

Yes, we should display the error before procReady has sent, but we should ignore after that. So I think we can add a field to indicate whether we have sent procReady or not in child process. It's not needed for the parent process, but we can reuse it to remove a local var seenProcReady.

Fix #4171

@lifubang lifubang requested a review from kolyshkin January 14, 2024 05:27
@lifubang lifubang mentioned this pull request Jan 16, 2024
21 tasks
@rata
Copy link
Member

rata commented Jan 16, 2024

@lifubang can we add an integration test for this? So the next refactor doesn't regress on this.

@lifubang
Copy link
Member Author

can we add an integration test for this? So the next refactor doesn't regress on this.

Good idea, added two tests. Thanks.

@lifubang lifubang force-pushed the fix-syncPipeClose branch 2 times, most recently from 417ca41 to 1c3b067 Compare January 23, 2024 14:08
Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think atomic.Bool is nicer for this than using mutexes, but I don't have a strong opinion.

@lifubang lifubang force-pushed the fix-syncPipeClose branch 2 times, most recently from e92ac5d to 79f3d6a Compare January 24, 2024 16:25
Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry for the nitpicks

@AkihiroSuda AkihiroSuda merged commit 2dfc2fe into opencontainers:main Jan 27, 2024
@lifubang lifubang changed the title never send procError to parent process after sent procReady never send procError after the socket closed Jan 28, 2024
@lifubang lifubang deleted the fix-syncPipeClose branch October 15, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

writing sync procError: write sync: file already closed

5 participants